package com.cskaoyan._02method._03methodcases;

import java.util.Arrays;

/**
 * @author Macro_Ray
 * @since 2024/3/5 19:40
 */
// 把一个数组中的元素复制到另一个新数组中去
public class _01Test_04 {
    public static void main(String[] args) {
        int[] arr = {1,2,3,4,5};
        int[] newArr = new int[arr.length];
        for (int i = 0; i < arr.length; i++) {
            newArr[i]=arr[i];
            i++;
        }
        System.out.println(Arrays.toString(newArr));
    }
}
